home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-07-07 | 5.4 KB | 221 lines | [TEXT/MPS ] |
- // Copyright © 1993,1994 Apple Computer, Inc. All rights reserved.
-
- // app constants
- constant kAppMaxWidth := 240 ;
- constant kAppMaxHeight := 336 ;
-
-
- // read in the book
-
- bookFilePath := HOME&"Help Book Source.f" ;
-
- // open resource fork for pictures
- ref := OpenResFileX(bookFilePath);
-
- // load in the book
- load(bookFilePath);
-
- // close the resource file
- CloseResFileX(ref) ;
-
-
- // ---- End Project Data ----
-
-
- // ---- File Beyond Help.t ----
-
- // Before Script for "BeyondHelpApp"
- // Copyright © 1993,4 Apple Computer, Inc. All rights reserved.
-
- BeyondHelpApp :=
- {title: "Beyond Help",
- viewBounds: {left: 0, top: 2, right: 236, bottom: 334},
- theBook:
- book
- // defined in ProjectData, from Dickens output.,
- viewSetupDoneScript:
- func()
- begin
- // create the new help book that uses the same proto as the system
- // help book (TinyTim).
- // NOTE/WARNING: TinyTime is NOT the proto, it IS the system help book.
- // You want the _proto of TinyTime.
-
- self.myHelpBook := BuildContext({_proto: GetRoot().TinyTim._proto, bookRef: theBook});
- end,
- viewQuitScript:
- func()
- begin
- myHelpBook:Close(); // do this so card can be removed
- myHelpBook := nil // do this so help book can be GC'd
- end,
- declareSelf: 'base,
- viewFlags: 4,
- viewFormat: 593,
- viewSetupFormScript:
- func()
- begin
- // resize application to the screen
- local b := GetAppParams();
- viewBounds := RelBounds(b.AppAreaLeft, b.AppAreaTop,
- MIN(kAppMaxWidth, b.appAreaWidth),
- MIN(kAppMaxHeight, b.appAreaHeight));
- end,
- AppInfoItems: ["Help"],
- InfoItemSelected:
- func(item)
- begin
- // this is where you respond to the info button
- // see the pickActionScript in the protoInfoButton to
- // to see where this script is called from.
-
- // see the infoButton sample for details on protoInfoButton
-
- GetRoot().TinyTim:Close(); // in case system help is open
- // OpenManaul is a method of the TinyTim helpbook
- myHelpBook:OpenManual(theBook);
-
- end,
- viewclass: 74,
- debug: "BeyondHelpApp"
- };
-
-
- // ---- File protoAdjustoButton ----
-
- // Before Script for "_userproto000"
- // Copyright, © 1994 Apple Computer. All rights reserved.
-
- _userproto000 :=
- {buttonHeight: 13,
- textSpacer: 8,
- viewSetupFormScript:
- func()
- begin
- viewBounds := RelBounds(viewBounds.left, viewBounds.top,
- StrFontWidth(text, viewFont) + textSpacer, buttonHeight) ;
- end,
- viewChangedScript:
- func(slot, view)
- begin
- inherited:?viewChangedScript(slot, view) ;
- if slot = 'text then
- :SyncView(); // SyncView causes the viewSetupFormScript to be called again,
- // which sets the size based on the text.
- end,
- _proto: protoTextButton
- };
-
-
- // ---- Back in File Beyond Help.t ----
- OpenManualTo := /* child of BeyondHelpApp */
- {text: "Llama Topic",
- buttonClickScript:
- func()
- begin
- GetRoot().TinyTim:Close(); // in case system help is open
- // OpenManualTo is a method of TinyTim See help book doc
- myHelpBook:OpenManualTo(theBook, "LlamaTopic");
- end,
- viewBounds: {left: 68, top: 122, right: 144, bottom: 134},
- _proto: _userproto000,
- debug: "OpenManualTo"
- };
-
-
-
- _view000 := /* child of BeyondHelpApp */ {_proto: protoStatus};
-
-
- // ---- File protoInfoButton ----
-
- // Before Script for "info"
- // Copyright ©1994 Apple Computer, Inc., All Rights Reserved.
-
- info :=
- {viewBounds: {left: 17, top: 0, right: 30, bottom: 12},
- viewFormat: 67109457,
- pickCancelledScript:
- func()
- begin
- :Hilite(nil);
- end,
- icon: GetPictAsBits("info icon", nil),
- viewClickScript:
- func(unit)
- begin
- if :TrackHilite(unit) then
- begin
- local l := :LocalBox();
-
- DoPopUp(AppInfoItems, l.right+3, l.top, self);
- end;
- end,
- viewFlags: 513,
- viewclass: 76,
- debug: "info"
- };
-
- // After Script for "info"
- thisView := info;
- // set the bounds of the button so that it is to the right
- // of the clock and the correct height for the status bar
-
- // NOTE: this is the first button, so argument to the
- // ButtonBounds function MUST be negative
- thisView.viewBounds := ButtonBounds(-(thisView.viewBounds.right - thisView.viewBounds.left));
-
-
- // ---- Back in File Beyond Help.t ----
- _view001 := /* child of _view000 */
- {
- pickActionScript:
- func(index)
- begin
- // MUST do this
- :Hilite(nil);
-
- :InfoItemSelected(index) ;
- end,
- _proto: info
- };
-
-
-
-
-
- _view002 := /* child of BeyondHelpApp */
- {
- text:
- "To see the sample help book, click on the Info button and choose \"Help\""
- ,
- viewBounds: {top: -65, left: 18, right: 148, bottom: -20},
- viewJustify: 128,
- viewFont: {family: 'espy, face: kFaceNormal, size: 10},
- _proto: protoStaticText
- };
-
-
-
- _view003 := /* child of BeyondHelpApp */
- {viewBounds: {left: -8, top: 8, right: 48, bottom: 24}, _proto: protoTitle};
-
-
-
- _view004 := /* child of BeyondHelpApp */
- {text: "Click on this button to open the Help Book to the Llama Topic",
- viewBounds: {left: 50, top: 64, right: 170, bottom: 120},
- viewJustify: 6,
- viewFont: {family: 'espy, face: kFaceNormal, size: 10},
- _proto: protoStaticText
- };
-
-
-
-
-
-
-
- // ---- Beginning of section for non used Layout files ----
-
- // End of output